Fix alias output naming and improve Spike I/O diagnostics#51
Merged
Conversation
vgene
suggested changes
Apr 3, 2026
vgene
reviewed
Apr 3, 2026
| model_core_id = self.model_ref.core_id | ||
|
|
||
| unknown_inputs = set(inputs) - set(self.input_tensors_info) | ||
| if unknown_inputs: |
Always lower non-aliased results as output{idx}, even when tracing assigned an intermediate name. Keep alias naming in NKIPy lowering, add direct NEFF naming coverage, and improve Spike I/O mismatch diagnostics without teaching Spike alias policy.
hgt312
force-pushed
the
alias-output-naming-fix
branch
from
July 10, 2026 06:44
aa46211 to
41bd1a8
Compare
Contributor
Author
|
@vgene can you help review again? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix alias output naming and improve Spike I/O diagnostics
Problem
The tracer's output naming step (Step 3 in NKIPyKernel._build_code) used a truthiness check (if not r.backend_tensor.name) to decide whether to assign the canonical
output{idx} name. This failed when a non-aliased output tensor already carried a name from tracing (e.g. "intermediate0" from an np.add result). The tensor kept
its intermediate name, causing a mismatch between the NEFF I/O table and what callers pass to kernel(inputs={...}, outputs={...}).
This was discovered during sglang-nkipy integration with the stable neuronx-cc 2.23.6484.0 compiler, where three kernel call patterns broke:
output
Debugging these required extracting NEFF I/O names from HLO protobuf binaries because Spike's _validate_io only produced a bare KeyError.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.